package com.education.welco.service.impl;

import com.education.common.utils.Convert;
import com.education.welco.mapper.TTeacherClassMapper;
import com.education.welco.pojo.TTeacherClass;
import com.education.welco.service.ITTeacherClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 教师班级关系 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class TTeacherClassServiceImpl implements ITTeacherClassService {

    @Autowired
    private TTeacherClassMapper tTeacherClassMapper;

    @Override
    public List<Integer> selectTTeacherClassByTeaId(Integer teacherId) {
        return tTeacherClassMapper.selectTTeacherClassByTeaId(teacherId);
    }

    /**
     * 查询教师班级关系信息
     *
     * @param teacherId 教师班级关系ID
     * @return 教师班级关系信息
     */
    @Override
    public TTeacherClass selectTTeacherClassById(Integer teacherId) {
        return tTeacherClassMapper.selectTTeacherClassById(teacherId);
    }

    /**
     * 查询教师班级关系列表
     *
     * @param tTeacherClass 教师班级关系信息
     * @return 教师班级关系集合
     */
    @Override
    public List<TTeacherClass> selectTTeacherClassList(TTeacherClass tTeacherClass) {
        return tTeacherClassMapper.selectTTeacherClassList(tTeacherClass);
    }

    /**
     * 新增教师班级关系
     *
     * @param tTeacherClass 教师班级关系信息
     * @return 结果
     */
    @Override
    public int insertTTeacherClass(TTeacherClass tTeacherClass) {
        return tTeacherClassMapper.insertTTeacherClass(tTeacherClass);
    }

    /**
     * 删除教师班级关系信息
     *
     * @param id 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTTeacherClassById(Integer id) {
        return tTeacherClassMapper.deleteTTeacherClassById(id);
    }

    /**
     * 根据班级id 进行删除
     * @param classId
     * @return
     */
    @Override
    public int deleteTTeacherClassByClassId(Integer classId) {
        return tTeacherClassMapper.deleteTTeacherClassByClassId(classId);
    }

    /**
     * 修改教师班级关系
     *
     * @param tTeacherClass 教师班级关系信息
     * @return 结果
     */
    @Override
    public int updateTTeacherClass(TTeacherClass tTeacherClass) {
        return tTeacherClassMapper.updateTTeacherClass(tTeacherClass);
    }

    /**
     * 删除教师班级关系对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTTeacherClassByIds(String ids) {
        return tTeacherClassMapper.deleteTTeacherClassByIds(Convert.toStrArray(ids));
    }
}